set_dvar(dvar, default_setting, min, max)
{
	// NOTE: MAKE SURE YOU CALL FOR A MINIMUM IF THIS IS AN INTEGER!

	if (!isDefined(default_setting))
		return;

	if (!isDefined(min))
		min = undefined;

	if (!isDefined(max))
		max = undefined;

	if (getcvar(dvar) == "")
		setcvar(dvar, default_setting);

	if (isDefined(min) && getcvarint(dvar) < min)
		setcvar(dvar, min);

	if (isDefined(max) && getcvarint(dvar) > max)
		setcvar(dvar, max);

	if (isDefined(min))
		return getcvarint(dvar);
	else
		return getcvar(dvar);
}

get_weaponlist()
{
	misc_weap = [];
	misc_weap[0]	= "weapon_bar_mp";
	misc_weap[1] 	= "weapon_bren_mp";
	misc_weap[2] 	= "weapon_colt_mp";
	misc_weap[3] 	= "weapon_enfield_mp";
	misc_weap[4] 	= "weapon_enfield_scope_mp";
	misc_weap[5] 	= "weapon_frag_grenade_american_mp";
	misc_weap[6] 	= "weapon_frag_grenade_british_mp";
	misc_weap[7] 	= "weapon_frag_grenade_german_mp";
	misc_weap[8] 	= "weapon_frag_grenade_russian_mp";
	misc_weap[9] 	= "weapon_g43_mp";
	misc_weap[10] 	= "weapon_greasegun_mp";
	misc_weap[11] 	= "weapon_kar98k_mp";
	misc_weap[12] 	= "weapon_kar98k_sniper_mp";
	misc_weap[13] 	= "weapon_luger_mp";
	misc_weap[14] 	= "weapon_m1carbine_mp";
	misc_weap[15] 	= "weapon_m1garand_mp";
	misc_weap[16] 	= "weapon_mosin_nagant_mp";
	misc_weap[17] 	= "weapon_mosin_nagant_sniper_mp";
	misc_weap[18] 	= "weapon_mp40_mp";
	misc_weap[19] 	= "weapon_mp44_mp";
	misc_weap[20] 	= "weapon_panzerschreck_mp";
	misc_weap[21] 	= "weapon_pps42_mp";
	misc_weap[22] 	= "weapon_ppsh_mp";
	misc_weap[23] 	= "weapon_shotgun_mp";
	misc_weap[24] 	= "weapon_smoke_grenade_american_mp";
	misc_weap[25] 	= "weapon_smoke_grenade_british_mp";
	misc_weap[26] 	= "weapon_smoke_grenade_german_mp";
	misc_weap[27] 	= "weapon_smoke_grenade_russian_mp";
	misc_weap[28] 	= "weapon_springfield_mp";
	misc_weap[29] 	= "weapon_sten_mp";
	misc_weap[30] 	= "weapon_SVT40_mp";
	misc_weap[31] 	= "weapon_thompson_mp";
	misc_weap[32] 	= "weapon_tt30_mp";
	misc_weap[33] 	= "weapon_webley_mp";
	
	return misc_weap;
}